#ifndef BITREE_H
#define BITREE_H

#include <iostream>
#include <string>
using namespace std;
typedef char ElemType;
typedef struct BiTreeNode{
    BiTreeNode * lchild;
    ElemType data;
    BiTreeNode * rchild;

}BiTreeNode,*BiTree;

struct StackType{
    BiTreeNode * base;
    BiTreeNode * top;
    int stacksize;
};
#define INIT_STACK_SIZE 10*sizeof(ElemType)
#define STACK_INCREMENT sizeof(ElemType)


void initTree(BiTree &b);
bool isEmptyTree(BiTree &b);
int getTreeDepth(BiTree &b);
ElemType getRootData(BiTree &b);
void createTree(BiTree &tree);
void preOrderTraverse(BiTree &tree);
void inOrderTraverse(BiTree &tree);
void postOrderTraverse(BiTree &tree);

class Stack{
public:
    StackType s;
public:
    bool isEmpty(void);
    void init(void);
    void display(string comment);
    void push(BiTreeNode e);
    void pop(BiTreeNode &e);
    BiTreeNode* getTop(void);
};

#endif // BITREE_H

